Release 10.1A: OpenEdge Development:
Web Services


Client method call to SOAP request/response message pair (run time)

This is a sample VB.NET method call to the FindCustomerByNum( ) method defined in the client interface, where the OrderInfo AppObject instance on which the method is called is named webService:

Interface method call (VB.NET) generating SOAP messages
Dim CustomerName As String 
webService.FindCustomerByNum(3, CustomerName) 

Thus, the call passes a value of 3 for the CustomerNumber parameter as input and receives the value returned by the CustomerName output parameter in a variable that happens also to be named CustomerName.

This is the SOAP request message sent out by the client after invoking the FindCustomerByNum( ) method. You can see that the value (3) for the input parameter, CustomerNumber, is passed in the SOAP message body.

Note that the AppObject ID for OrderInfo is sent along in the SOAP header (<UUID> element). .NET sends the AppObject ID automatically. For other client platforms, you have might have to code this information into the SOAP message before it is sent:

SOAP request message for method input parameters
<?xml version="1.0" encoding="utf-8" ?> 
<soap:Envelope namespaces defined here...> 
   <soap:Header> 
      <q1:OrderInfoID id="h_id1" 
         xmlns:q1="urn:OrderSvc:OrderInfo"> 
         <UUID xsi:type="xsd:string">2e62cab6b81150d5:167f64e:f295e997b0: 
         -8000;<OrderInfo|PX-000001|AO>;M/IryPm3piDcF/W5DsH4GA==</UUID> 
      </q1:OrderInfoID> 
   <soap:Header> 
   <soap:Body 
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
      <q1:FindCustomerByNum xmlns:q1="urn:OrderSvc:OrderInfo"> 
         <CustomerNumber xsi:type="xsd:int">3</CustomerNumber> 
      </q1:FindCustomerByNum> 
   </soap:Body> 
</soap:Envelope> 

For more information on how object IDs are defined, obtained, and sent in SOAP messages, see the "Retrieving and sending object IDs—handling SOAP headers" section.

This is the SOAP response message returned by the WSA with the value ("Hoops") for the output parameter, CustomerName:

SOAP response message for method output parameters
<?xml version="1.0" encoding="UTF-8" ?> 
<soap:Envelope namespaces defined here...> 
   <soap:Body> 
      <ns1:FindCustomerByNumResponse xmlns:ns1="urn:OrderSvc:OrderInfo" 
         soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
      <CustomerName xsi:type="xsd:string">Hoops</CustomerName> 
      </ns1:FindCustomerByNumResponse> 
   </soap:Body> 
</soap:Envelope> 

If an error occurred at any point after the SOAP request message was received by the WSA, a SOAP fault message would be returned instead of the SOAP response message shown in the example. For information on SOAP fault messages returned for a method, see the "Handling Web service errors and SOAP faults" section.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095